/*
** my_putnbr_base.c for my_putnbr_base in /home/chassa_m/rendu/PSU_2013_my_printf
** 
** Made by chassa_m
** Login   <chassa_m@epitech.net>
** 
** Started on  Sun Nov 17 13:49:31 2013 chassa_m
** Last update Sun Nov 17 14:06:56 2013 chassa_m
*/

int	my_putnbr_base(unsigned int nb, char *base)
{
  int	result;
  int	div;
  int	size_base;

  size_base = my_strlen(base);
  div = 1;
  while ((nb / div) >= size_base)
    div = div * size_base;
  while (div > 0)
    {
      result = (nb / div) % size_base;
      my_putchar(base[result]);
      div = div / size_base;
    }
}
